<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
    </style>
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=3.0&ak=ZDWA8lF9Eb7Wc8iTLTk9m43aVlpXkY3H"></script>
    <title>地图展示</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
    // GL版命名空间为BMapGL
    // 按住鼠标右键，修改倾斜角和角度
    var map = new BMap.Map("allmap");    // 创建Map实例
    var geoc = new BMap.Geocoder();
    map.centerAndZoom(new BMap.Point(117.321, 38.391), 15);  // 初始化地图,设置中心点坐标和地图级别
    map.enableScrollWheelZoom();    // 启动鼠标滚轮操作
    map.addEventListener('click', function(e) {
        var pt = e.point;
        geoc.getLocation(pt, function(rs){
            var addComp = rs.addressComponents;
            var info = {point:pt,addComp:addComp};
            window.parent.postMessage(info, '*');
        });
    });
</script>
